<?php
namespace BP\Sys;

use BP\En\EntityNoName;

require_once("BP/En/Map.php");
class ExcelField extends EntityNoName {
	public function getCellName () 
	{
		return $this->GetValStrByKey(ExcelFieldAttr::$CellName);
	}
	public function setCellName ($value) // [String value]
	{
		$this->SetValByKey(ExcelFieldAttr::$CellName, $value);
	}
	public function getCellRow () 
	{
		return $this->GetValIntByKey(ExcelFieldAttr::$CellRow);
	}
	public function setCellRow ($value) // [int value]
	{
		$this->SetValByKey(ExcelFieldAttr::$CellRow, $value);
	}
	public function getCellColumn () 
	{
		return $this->GetValIntByKey(ExcelFieldAttr::$CellColumn);
	}
	public function setCellColumn ($value) // [int value]
	{
		$this->SetValByKey(ExcelFieldAttr::$CellColumn, $value);
	}
	public function getFK_ExcelSheet () 
	{
		return $this->GetValStrByKey(ExcelFieldAttr::$FK_ExcelSheet);
	}
	public function setFK_ExcelSheet ($value) // [String value]
	{
		$this->SetValByKey(ExcelFieldAttr::$FK_ExcelSheet, $value);
	}
	public function getField () 
	{
		return $this->GetValStrByKey(ExcelFieldAttr::$Field);
	}
	public function setField ($value) // [String value]
	{
		$this->SetValByKey(ExcelFieldAttr::$Field, $value);
	}
	public function getFK_ExcelTable () 
	{
		return $this->GetValStrByKey(ExcelFieldAttr::$FK_ExcelTable);
	}
	public function setFK_ExcelTable ($value) // [String value]
	{
		$this->SetValByKey(ExcelFieldAttr::$FK_ExcelTable, $value);
	}
	public function getDataType () 
	{
		return ExcelFieldDataType->forValue($this->GetValIntByKey(ExcelFieldAttr::$DataType, 0));
	}
	public function setDataType ($value) // [ExcelFieldDataType value]
	{
		$this->SetValByKey(ExcelFieldAttr::$DataType, $value->getValue());
	}
	public function getUIBindKey () 
	{
		return $this->GetValStrByKey(ExcelFieldAttr::$UIBindKey);
	}
	public function setUIBindKey ($value) // [String value]
	{
		$this->SetValByKey(ExcelFieldAttr::$UIBindKey, $value);
	}
	public function getUIRefKey () 
	{
		return $this->GetValStrByKey(ExcelFieldAttr::$UIRefKey);
	}
	public function setUIRefKey ($value) // [String value]
	{
		$this->SetValByKey(ExcelFieldAttr::$UIRefKey, $value);
	}
	public function getUIRefKeyText () 
	{
		return $this->GetValStrByKey(ExcelFieldAttr::$UIRefKeyText);
	}
	public function setUIRefKeyText ($value) // [String value]
	{
		$this->SetValByKey(ExcelFieldAttr::$UIRefKeyText, $value);
	}
	public function getValidators () 
	{
		return $this->GetValStrByKey(ExcelFieldAttr::$Validators);
	}
	public function setValidators ($value) // [String value]
	{
		$this->SetValByKey(ExcelFieldAttr::$Validators, $value);
	}
	public function getFK_ExcelFile () 
	{
		return $this->GetValStrByKey(ExcelFieldAttr::$FK_ExcelFile);
	}
	public function setFK_ExcelFile ($value) // [String value]
	{
		$this->SetValByKey(ExcelFieldAttr::$FK_ExcelFile, $value);
	}
	public function getAtPara () 
	{
		return $this->GetValStrByKey(ExcelFieldAttr::$AtPara);
	}
	public function setAtPara ($value) // [String value]
	{
		$this->SetValByKey(ExcelFieldAttr::$AtPara, $value);
	}
	public function getConfirmKind () 
	{
		return ConfirmKind->forValue($this->GetValIntByKey(ExcelFieldAttr::$ConfirmKind, 0));
	}
	public function setConfirmKind ($value) // [ConfirmKind value]
	{
		$this->SetValByKey(ExcelFieldAttr::$ConfirmKind, $value->getValue());
	}
	public function getConfirmCellCount () 
	{
		return $this->GetValIntByKey(ExcelFieldAttr::$ConfirmCellCount, 1);
	}
	public function setConfirmCellCount ($value) // [int value]
	{
		$this->SetValByKey(ExcelFieldAttr::$ConfirmCellCount, $value);
	}
	public function getConfirmCellValue () 
	{
		return $this->GetValStrByKey(ExcelFieldAttr::$ConfirmCellValue);
	}
	public function setConfirmCellValue ($value) // [String value]
	{
		$this->SetValByKey(ExcelFieldAttr::$ConfirmCellValue, $value);
	}
	public function getConfirmRepeatIndex () 
	{
		return $this->GetValIntByKey(ExcelFieldAttr::$ConfirmRepeatIndex);
	}
	public function setConfirmRepeatIndex ($value) // [int value]
	{
		$this->SetValByKey(ExcelFieldAttr::$ConfirmRepeatIndex, $value);
	}
	public function getSkipIsNull () 
	{
		return $this->GetValBooleanByKey(ExcelFieldAttr::$SkipIsNull,  FALSE );
	}
	public function setSkipIsNull ($value) // [boolean value]
	{
		$this->SetValByKey(ExcelFieldAttr::$SkipIsNull, $value);
	}
	public function getSyncToField () 
	{
		return $this->GetValStrByKey(ExcelFieldAttr::$SyncToField);
	}
	public function setSyncToField ($value) // [String value]
	{
		$this->SetValByKey(ExcelFieldAttr::$SyncToField, $value);
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public function getHisUAC () 
	{
		$uac = new UAC();
		$uac->OpenAll();
		return $uac;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map("Sys_ExcelField");
		$map->setEnDesc("Excel字段");
		$map->AddTBStringPK(ExcelFieldAttr::$No, NULL, "编号",  TRUE ,  TRUE , 1, 36, 200);
		$map->AddTBString(ExcelFieldAttr::$Name, NULL, "名称",  TRUE ,  FALSE , 1, 50, 100);
		$map->AddTBString(ExcelFieldAttr::$CellName, NULL, "单元格名�?",  TRUE ,  FALSE , 1, 50, 100);
		$map->AddTBInt(ExcelFieldAttr::$CellRow, 0, "行号",  TRUE ,  FALSE );
		$map->AddTBInt(ExcelFieldAttr::$CellColumn, 0, "列号",  TRUE ,  FALSE );
		$map->AddDDLEntities(ExcelFieldAttr::$FK_ExcelSheet, NULL, "�?属ExcelSheet�?", ExcelSheets::constructor__(),  FALSE );
		$map->AddTBString(ExcelFieldAttr::$Field, NULL, "存储字段�?",  TRUE ,  FALSE , 1, 50, 100);
		$map->AddDDLEntities(ExcelFieldAttr::$FK_ExcelTable, NULL, "存储数据�?", ExcelTables::constructor__(),  FALSE );
		$map->AddDDLSysEnum(ExcelFieldAttr::$DataType, 0, "值类�?",  TRUE ,  TRUE , ExcelFieldAttr::$DataType, "@0=字符串@1=整数@2=浮点数@3=日期@4=日期时间@5=外键@6=枚举");
		$map->AddTBString(ExcelFieldAttr::$UIBindKey, NULL, "外键�?/枚举",  TRUE ,  FALSE , 1, 100, 100);
		$map->AddTBString(ExcelFieldAttr::$UIRefKey, NULL, "外键表No",  TRUE ,  FALSE , 1, 30, 100);
		$map->AddTBString(ExcelFieldAttr::$UIRefKeyText, NULL, "外键表Name",  TRUE ,  FALSE , 1, 30, 100);
		$map->AddTBString(ExcelFieldAttr::$Validators, NULL, "校验�?",  TRUE ,  FALSE , 1, 4000, 100);
		$map->AddDDLEntities(ExcelFieldAttr::$FK_ExcelFile, NULL, "�?属Excel模板", ExcelFiles::constructor__(),  FALSE );
		$map->AddTBStringDoc(ExcelFieldAttr::$AtPara, NULL, "参数",  TRUE ,  FALSE ,  TRUE );
		$map->AddDDLSysEnum(ExcelFieldAttr::$ConfirmKind, 0, "单元格确认方�?",  TRUE ,  TRUE , ExcelFieldAttr::$ConfirmKind, "@0=当前单元格@1=左方单元格@2=上方单元格@3=右方单元格@4=下方单元�?");
		$map->AddTBInt(ExcelFieldAttr::$ConfirmCellCount, 1, "单元格确认方向移动量",  TRUE ,  FALSE );
		$map->AddTBString(ExcelFieldAttr::$ConfirmCellValue, NULL, "对应单元格�??",  TRUE ,  FALSE , 1, 200, 100);
		$map->AddTBInt(ExcelFieldAttr::$ConfirmRepeatIndex, 0, "对应单元格�?�重复�?�定次序",  TRUE ,  FALSE );
		$map->AddBoolean(ExcelFieldAttr::$SkipIsNull,  FALSE , "不计非空",  TRUE ,  TRUE );
		$map->AddTBString(ExcelFieldAttr::$SyncToField, NULL, "同步到字�?",  TRUE ,  FALSE , 1, 100, 100);
		$this->set_enMap($map);
		return $this->get_enMap();
	}
	protected function beforeInsert () 
	{
		if ($this->IsExit(ExcelFieldAttr::$CellName, $this->getCellName(), ExcelFieldAttr::$FK_ExcelSheet, $this->getFK_ExcelSheet(), ExcelFieldAttr::$FK_ExcelTable, $this->getFK_ExcelTable()))
		{
			throw new \RuntimeException((("单元�? " . $this->getCellName()) . " 已经使用，不能重复使用！"));
		}
		$this->setNo($UUID->randomUUID());
		return parent->beforeInsert();
	}
}
?>
